3.2.66 \(\int x^2 (a+b \tanh ^{-1}(\frac {c}{x^2})) \, dx\) [166]

Optimal. Leaf size=61 \[ \frac {2 b c x}{3}-\frac {1}{3} b c^{3/2} \text {ArcTan}\left (\frac {x}{\sqrt {c}}\right )+\frac {1}{3} x^3 \left (a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )\right )-\frac {1}{3} b c^{3/2} \tanh ^{-1}\left (\frac {x}{\sqrt {c}}\right ) \]

[Out]

2/3*b*c*x-1/3*b*c^(3/2)*arctan(x/c^(1/2))+1/3*x^3*(a+b*arctanh(c/x^2))-1/3*b*c^(3/2)*arctanh(x/c^(1/2))

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {6037, 199, 327, 218, 212, 209} \begin {gather*} \frac {1}{3} x^3 \left (a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )\right )-\frac {1}{3} b c^{3/2} \text {ArcTan}\left (\frac {x}{\sqrt {c}}\right )-\frac {1}{3} b c^{3/2} \tanh ^{-1}\left (\frac {x}{\sqrt {c}}\right )+\frac {2 b c x}{3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^2*(a + b*ArcTanh[c/x^2]),x]

[Out]

(2*b*c*x)/3 - (b*c^(3/2)*ArcTan[x/Sqrt[c]])/3 + (x^3*(a + b*ArcTanh[c/x^2]))/3 - (b*c^(3/2)*ArcTanh[x/Sqrt[c]]
)/3

Rule 199

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[x^(n*p)*(b + a/x^n)^p, x] /; FreeQ[{a, b}, x] && LtQ[n, 0]
 && IntegerQ[p]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 218

Int[((a_) + (b_.)*(x_)^4)^(-1), x_Symbol] :> With[{r = Numerator[Rt[-a/b, 2]], s = Denominator[Rt[-a/b, 2]]},
Dist[r/(2*a), Int[1/(r - s*x^2), x], x] + Dist[r/(2*a), Int[1/(r + s*x^2), x], x]] /; FreeQ[{a, b}, x] &&  !Gt
Q[a/b, 0]

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 6037

Int[((a_.) + ArcTanh[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*((a + b*ArcTanh[c*
x^n])^p/(m + 1)), x] - Dist[b*c*n*(p/(m + 1)), Int[x^(m + n)*((a + b*ArcTanh[c*x^n])^(p - 1)/(1 - c^2*x^(2*n))
), x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] && IntegerQ[m])) && NeQ[m, -1
]

Rubi steps

\begin {align*} \int x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )\right ) \, dx &=\frac {1}{3} x^3 \left (a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )\right )+\frac {1}{3} (2 b c) \int \frac {1}{1-\frac {c^2}{x^4}} \, dx\\ &=\frac {1}{3} x^3 \left (a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )\right )+\frac {1}{3} (2 b c) \int \frac {x^4}{-c^2+x^4} \, dx\\ &=\frac {2 b c x}{3}+\frac {1}{3} x^3 \left (a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )\right )+\frac {1}{3} \left (2 b c^3\right ) \int \frac {1}{-c^2+x^4} \, dx\\ &=\frac {2 b c x}{3}+\frac {1}{3} x^3 \left (a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )\right )-\frac {1}{3} \left (b c^2\right ) \int \frac {1}{c-x^2} \, dx-\frac {1}{3} \left (b c^2\right ) \int \frac {1}{c+x^2} \, dx\\ &=\frac {2 b c x}{3}-\frac {1}{3} b c^{3/2} \tan ^{-1}\left (\frac {x}{\sqrt {c}}\right )+\frac {1}{3} x^3 \left (a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )\right )-\frac {1}{3} b c^{3/2} \tanh ^{-1}\left (\frac {x}{\sqrt {c}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 86, normalized size = 1.41 \begin {gather*} \frac {2 b c x}{3}+\frac {a x^3}{3}-\frac {1}{3} b c^{3/2} \text {ArcTan}\left (\frac {x}{\sqrt {c}}\right )+\frac {1}{3} b x^3 \tanh ^{-1}\left (\frac {c}{x^2}\right )+\frac {1}{6} b c^{3/2} \log \left (\sqrt {c}-x\right )-\frac {1}{6} b c^{3/2} \log \left (\sqrt {c}+x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^2*(a + b*ArcTanh[c/x^2]),x]

[Out]

(2*b*c*x)/3 + (a*x^3)/3 - (b*c^(3/2)*ArcTan[x/Sqrt[c]])/3 + (b*x^3*ArcTanh[c/x^2])/3 + (b*c^(3/2)*Log[Sqrt[c]
- x])/6 - (b*c^(3/2)*Log[Sqrt[c] + x])/6

________________________________________________________________________________________

Maple [A]
time = 0.16, size = 53, normalized size = 0.87

method result size
derivativedivides \(\frac {x^{3} a}{3}+\frac {x^{3} b \arctanh \left (\frac {c}{x^{2}}\right )}{3}+\frac {2 b c x}{3}+\frac {b \,c^{\frac {3}{2}} \arctan \left (\frac {\sqrt {c}}{x}\right )}{3}-\frac {b \,c^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {c}}{x}\right )}{3}\) \(53\)
default \(\frac {x^{3} a}{3}+\frac {x^{3} b \arctanh \left (\frac {c}{x^{2}}\right )}{3}+\frac {2 b c x}{3}+\frac {b \,c^{\frac {3}{2}} \arctan \left (\frac {\sqrt {c}}{x}\right )}{3}-\frac {b \,c^{\frac {3}{2}} \arctanh \left (\frac {\sqrt {c}}{x}\right )}{3}\) \(53\)
risch \(\frac {x^{3} b \ln \left (x^{2}+c \right )}{6}-\frac {x^{3} b \ln \left (-x^{2}+c \right )}{6}-\frac {i \pi b \,x^{3} \mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{2}}{12}-\frac {i \pi b \,x^{3} \mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (i \left (x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )}{12}+\frac {i \pi b \,x^{3} \mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (i \left (-x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )}{12}+\frac {i \pi b \,x^{3} \mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )^{2}}{12}+\frac {i \pi b \,x^{3} \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{2}}{6}-\frac {i \pi b \,x^{3} \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )^{3}}{12}+\frac {i \pi b \,x^{3} \mathrm {csgn}\left (i \left (x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )^{2}}{12}-\frac {i \pi b \,x^{3} \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{3}}{12}-\frac {i \pi b \,x^{3} \mathrm {csgn}\left (i \left (-x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{2}}{12}-\frac {i \pi b \,x^{3}}{6}+\frac {x^{3} a}{3}+\frac {2 b c x}{3}+\frac {c \sqrt {-c}\, b \ln \left (\sqrt {-c}\, c -c x \right )}{6}-\frac {c \sqrt {-c}\, b \ln \left (-\sqrt {-c}\, c -c x \right )}{6}+\frac {c^{\frac {3}{2}} b \ln \left (c^{\frac {3}{2}}-c x \right )}{6}-\frac {c^{\frac {3}{2}} b \ln \left (-c^{\frac {3}{2}}-c x \right )}{6}\) \(396\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a+b*arctanh(c/x^2)),x,method=_RETURNVERBOSE)

[Out]

1/3*x^3*a+1/3*x^3*b*arctanh(c/x^2)+2/3*b*c*x+1/3*b*c^(3/2)*arctan(1/x*c^(1/2))-1/3*b*c^(3/2)*arctanh(1/x*c^(1/
2))

________________________________________________________________________________________

Maxima [A]
time = 0.47, size = 61, normalized size = 1.00 \begin {gather*} \frac {1}{3} \, a x^{3} + \frac {1}{6} \, {\left (2 \, x^{3} \operatorname {artanh}\left (\frac {c}{x^{2}}\right ) - {\left (2 \, \sqrt {c} \arctan \left (\frac {x}{\sqrt {c}}\right ) - \sqrt {c} \log \left (\frac {x - \sqrt {c}}{x + \sqrt {c}}\right ) - 4 \, x\right )} c\right )} b \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*arctanh(c/x^2)),x, algorithm="maxima")

[Out]

1/3*a*x^3 + 1/6*(2*x^3*arctanh(c/x^2) - (2*sqrt(c)*arctan(x/sqrt(c)) - sqrt(c)*log((x - sqrt(c))/(x + sqrt(c))
) - 4*x)*c)*b

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 162, normalized size = 2.66 \begin {gather*} \left [\frac {1}{6} \, b x^{3} \log \left (\frac {x^{2} + c}{x^{2} - c}\right ) + \frac {1}{3} \, a x^{3} - \frac {1}{3} \, b c^{\frac {3}{2}} \arctan \left (\frac {x}{\sqrt {c}}\right ) + \frac {1}{6} \, b c^{\frac {3}{2}} \log \left (\frac {x^{2} - 2 \, \sqrt {c} x + c}{x^{2} - c}\right ) + \frac {2}{3} \, b c x, \frac {1}{6} \, b x^{3} \log \left (\frac {x^{2} + c}{x^{2} - c}\right ) + \frac {1}{3} \, a x^{3} + \frac {1}{3} \, b \sqrt {-c} c \arctan \left (\frac {\sqrt {-c} x}{c}\right ) + \frac {1}{6} \, b \sqrt {-c} c \log \left (\frac {x^{2} - 2 \, \sqrt {-c} x - c}{x^{2} + c}\right ) + \frac {2}{3} \, b c x\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*arctanh(c/x^2)),x, algorithm="fricas")

[Out]

[1/6*b*x^3*log((x^2 + c)/(x^2 - c)) + 1/3*a*x^3 - 1/3*b*c^(3/2)*arctan(x/sqrt(c)) + 1/6*b*c^(3/2)*log((x^2 - 2
*sqrt(c)*x + c)/(x^2 - c)) + 2/3*b*c*x, 1/6*b*x^3*log((x^2 + c)/(x^2 - c)) + 1/3*a*x^3 + 1/3*b*sqrt(-c)*c*arct
an(sqrt(-c)*x/c) + 1/6*b*sqrt(-c)*c*log((x^2 - 2*sqrt(-c)*x - c)/(x^2 + c)) + 2/3*b*c*x]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 830 vs. \(2 (56) = 112\).
time = 2.84, size = 830, normalized size = 13.61 \begin {gather*} \begin {cases} \frac {a x^{3}}{3} & \text {for}\: c = 0 \\\frac {x^{3} \left (a - \infty b\right )}{3} & \text {for}\: c = - x^{2} \\\frac {x^{3} \left (a + \infty b\right )}{3} & \text {for}\: c = x^{2} \\- \frac {2 a c^{2} x^{3} \sqrt {- c}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} + \frac {2 a x^{7} \sqrt {- c}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} - \frac {2 b c^{\frac {7}{2}} \sqrt {- c} \log {\left (- \sqrt {c} + x \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} + \frac {b c^{\frac {7}{2}} \sqrt {- c} \log {\left (x - \sqrt {- c} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} + \frac {b c^{\frac {7}{2}} \sqrt {- c} \log {\left (x + \sqrt {- c} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} - \frac {2 b c^{\frac {7}{2}} \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} + \frac {2 b c^{\frac {3}{2}} x^{4} \sqrt {- c} \log {\left (- \sqrt {c} + x \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} - \frac {b c^{\frac {3}{2}} x^{4} \sqrt {- c} \log {\left (x - \sqrt {- c} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} - \frac {b c^{\frac {3}{2}} x^{4} \sqrt {- c} \log {\left (x + \sqrt {- c} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} + \frac {2 b c^{\frac {3}{2}} x^{4} \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} + \frac {b c^{4} \log {\left (x - \sqrt {- c} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} - \frac {b c^{4} \log {\left (x + \sqrt {- c} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} - \frac {4 b c^{3} x \sqrt {- c}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} - \frac {b c^{2} x^{4} \log {\left (x - \sqrt {- c} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} + \frac {b c^{2} x^{4} \log {\left (x + \sqrt {- c} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} - \frac {2 b c^{2} x^{3} \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} + \frac {4 b c x^{5} \sqrt {- c}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} + \frac {2 b x^{7} \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 6 c^{2} \sqrt {- c} + 6 x^{4} \sqrt {- c}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(a+b*atanh(c/x**2)),x)

[Out]

Piecewise((a*x**3/3, Eq(c, 0)), (x**3*(a - oo*b)/3, Eq(c, -x**2)), (x**3*(a + oo*b)/3, Eq(c, x**2)), (-2*a*c**
2*x**3*sqrt(-c)/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) + 2*a*x**7*sqrt(-c)/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c))
- 2*b*c**(7/2)*sqrt(-c)*log(-sqrt(c) + x)/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) + b*c**(7/2)*sqrt(-c)*log(x - s
qrt(-c))/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) + b*c**(7/2)*sqrt(-c)*log(x + sqrt(-c))/(-6*c**2*sqrt(-c) + 6*x*
*4*sqrt(-c)) - 2*b*c**(7/2)*sqrt(-c)*atanh(c/x**2)/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) + 2*b*c**(3/2)*x**4*sq
rt(-c)*log(-sqrt(c) + x)/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) - b*c**(3/2)*x**4*sqrt(-c)*log(x - sqrt(-c))/(-6
*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) - b*c**(3/2)*x**4*sqrt(-c)*log(x + sqrt(-c))/(-6*c**2*sqrt(-c) + 6*x**4*sqrt
(-c)) + 2*b*c**(3/2)*x**4*sqrt(-c)*atanh(c/x**2)/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) + b*c**4*log(x - sqrt(-c
))/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) - b*c**4*log(x + sqrt(-c))/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) - 4*b*
c**3*x*sqrt(-c)/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) - b*c**2*x**4*log(x - sqrt(-c))/(-6*c**2*sqrt(-c) + 6*x**
4*sqrt(-c)) + b*c**2*x**4*log(x + sqrt(-c))/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) - 2*b*c**2*x**3*sqrt(-c)*atan
h(c/x**2)/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) + 4*b*c*x**5*sqrt(-c)/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)) + 2*
b*x**7*sqrt(-c)*atanh(c/x**2)/(-6*c**2*sqrt(-c) + 6*x**4*sqrt(-c)), True))

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 69, normalized size = 1.13 \begin {gather*} \frac {1}{3} \, b c^{3} {\left (\frac {\arctan \left (\frac {x}{\sqrt {-c}}\right )}{\sqrt {-c} c} - \frac {\arctan \left (\frac {x}{\sqrt {c}}\right )}{c^{\frac {3}{2}}}\right )} + \frac {1}{6} \, b x^{3} \log \left (\frac {x^{2} + c}{x^{2} - c}\right ) + \frac {1}{3} \, a x^{3} + \frac {2}{3} \, b c x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*arctanh(c/x^2)),x, algorithm="giac")

[Out]

1/3*b*c^3*(arctan(x/sqrt(-c))/(sqrt(-c)*c) - arctan(x/sqrt(c))/c^(3/2)) + 1/6*b*x^3*log((x^2 + c)/(x^2 - c)) +
 1/3*a*x^3 + 2/3*b*c*x

________________________________________________________________________________________

Mupad [B]
time = 0.90, size = 65, normalized size = 1.07 \begin {gather*} \frac {a\,x^3}{3}-\frac {b\,c^{3/2}\,\mathrm {atan}\left (\frac {x}{\sqrt {c}}\right )}{3}+\frac {2\,b\,c\,x}{3}+\frac {b\,x^3\,\ln \left (x^2+c\right )}{6}-\frac {b\,x^3\,\ln \left (x^2-c\right )}{6}+\frac {b\,c^{3/2}\,\mathrm {atan}\left (\frac {x\,1{}\mathrm {i}}{\sqrt {c}}\right )\,1{}\mathrm {i}}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a + b*atanh(c/x^2)),x)

[Out]

(a*x^3)/3 - (b*c^(3/2)*atan(x/c^(1/2)))/3 + (b*c^(3/2)*atan((x*1i)/c^(1/2))*1i)/3 + (2*b*c*x)/3 + (b*x^3*log(c
 + x^2))/6 - (b*x^3*log(x^2 - c))/6

________________________________________________________________________________________